#ifndef _SINGLE_H
#define _SINGLE_H

#define initSing( type ) \
	template <> type * Single<type>::inst = 0

template<typename T>
class DLL_EXPORT Single
{
public:
	static T* inst;
	static T* getSingle()
	{
		if(!inst)
			throw("inst == 0 this is mostly a problem if didnt create an instance of the class");
		return inst;
	}

	Single()
	{
		if(inst)
			throw("inst != 0  you should only create one instance of a singleton class!");
		inst = (T*)this;
	}
};

#endif